<template>
  <div class="box">
    <!-- 
      v-model: 语法糖
      在输入框上: :value属性 + @input事件
     -->
    <input v-model="username" type="text" placeholder="请输入用户名">
    <br>
    <input :value="userAge" type="text" placeholder="请输入年龄" @input="userAge = $event.target.value">
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      userAge: ''
    }
  },
  methods: {
    changeAge(e) {
      // console.log(e)
      this.userAge = e.target.value
    }
  }
}
</script>

<style>
.box {
  width: 500px;
  height: 400px;
  background-color: red;
}
</style>
